import http from "@/utils/http";

/**
 * 小程序登录_内测版
 */
export const userLogin = (phoneNumber) => {
  return http({
    url: "/login/wxMin/simple",
    method: 'POST',
    data: { phoneNumber }
  });
};

/**
 * 获取个人信息
 * @returns 
 */
export function getProfile() {
  return http({
    url: '/member/profile'
  })
}

/**
 * 上传头像
 * @param {string:'文件地址'} filePath 
 * @returns 
 */
export function setAvatar(filePath) {
  return uni.uploadFile({
    url: '/member/profile/avatar',
    filePath,
    name: 'file'
  })
}

/**
 * 修改个人信息
 * @param {*} data 
 * @returns 
 */
export function setProfile(data) {
  return http({
    url: '/member/profile',
    method: 'PUT',
    data
  })
}